home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!the-fix.sos.on.ca
- From: <verneb@the-fix.sos.on.ca>
- Date: Thu,18 Jan 96 12:30:00 -0500
- Newsgroups: comp.lang.c
- Subject: ATTENTION C EXPERTS!! Extern Declarations - NEED H
- Message-ID: <tcpnntpd.16.1.18.12.30.0.2781597121.348422@the-fix.sos.on.ca>
- References: <dcd9516f@brazerko.com>
- Organization: the FIX - Kitchener, Ontario CANADA
- NNTP-Posting-Host: the-fix.sos.on.ca
- X-MajorTCP-Version: MajorTCP/IP [1.80-0]
-
- To: INT:tcassel@brazerko.com
-
- Int:tcassel@brazerko.com,
- From page 551 of The New C Primer Plus,
- The #ifndef directive commonly is used to prevent multiple
- inclusions of a file. That is, an include file may be set up along
- the following lines:
-
- /* things.h */
- #ifndef _THINGS_
- #define _THINGS_
- /* Rest of include file */
- #endif
-
- Suppose this file somehow got included sevefal times. The first
- time the preprocessor encounters this include file, _THINGS_is
- undefined, so the program proceeds to define _THINGS_ and to procedss
- the rest of the file. The next time the preprocessor encounters this
- file, _THINGS_ is defined, so the preprocessor skips the rest of the file.
-
- No where in my books can I find reference to #define _CDECL cdecl.
- In the back of my mind though I seem to recall reading something like
- this in the "C" Manual for the Amiga where it referred to changing
- value from one to another. This could mean that whenever a Capital C
- is punched a small c is used. Hope this gives a little help. If you
- are desparate I could take a lengthy look in the old manual but there
- is no index.
-
- I >I am having difficulty understanding the following code and every book I
- I >get on
- I >the subject does not explain the multiple MACROS that are in the
- I >definition.
- I >
- I >extern unsigned int _NEAR _CDECL _osversion;
- I >
- I >/* where _NEAR and _CDECL are macros defined as:*/
- I >
- I >#ifndef NO_KEYS
- I > #define _CDECL cdecl
- I > #define _NEAR near
- I >#else
- I > #define _CDECL
- I > #define _NEAR
- I >#endif
- I >
- I >/* There is only two places where cdecl and near are mentioned in the rest
- I >of
- I >the program - the following appears once in two seperate header files */
- I >
- I >#define _NEAR near
- I >#define _CDECL cdecl
- I >
- I >/* I am attempting to make this program ansi C compilable, and am stuck on
- I >this
- I >as I dont understand what the above code is doing. Any help would be
- I >greatly
- I >appreciated. Kind Regards, Thea Cassel tcassel@sisyphus.cit.gu.edu.au
- I >*/
- I >
- I >
- I >--
- I >.-----------------------------------------------------------------------.
- I >| The gateway is Brazerko Communications'; the opinions are the user's. |
- I >| sales@brazerko.com info@brazerko.com ('bot) +1 860 886 1441 (BBS) |
- I >`-----------------------------------------------------------------------'
- I >
-
- Verne H. Bohlender
- Box 416, Chesley, Ontario.Ca. N0G 1L0
- verneb@The-Fix.sos.on.ca
- ___
- * UniQWK #2158*
-
-